package com.neusoft.orcode.Service;

import com.alibaba.fastjson.JSON;
import com.neusoft.orcode.info.PatientInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

@Service
public class PatientService {

    @Autowired
    private RedisTemplate redisTemplate;

    public PatientInfo getPatientById(String auth_id){
        // 返回完整的患者信息
        PatientInfo patientInfo = JSON.parseObject((String) redisTemplate.opsForValue().get(auth_id), PatientInfo.class);
        return patientInfo;
    }

}
